Symbol reference

SYNOPSIS

pi_id | pi_reference(pi_data *);

PARAMETER

pi_data.from: | start position of the symbol reference relative to the pi_data.from position of the related (previous) pi_function() call
pi_data.name: | name of the symbol referred
pi_data.classname: | class name if the symbol is class member
pi_data.nameSpace: | only if symbol is a class member, full scope of class e.g., X.Y.Z
pi_data.flags: | {PI_FUNCTION | PI_VARIABLE | PI_MACRO | PI_TYPEDEF | PI_ENUM | PI_ENUM_ITEM | PI_STRUCT | PI_CLASS}, PI_READACCESS, PI_WRITEACCESS
pi_data.related: | pi_id of function definition or declaration referring to the symbolDefault: previous function definition/declaration

DESCRIPTION
This function must be called whenever the parser detects a function which refers to a symbol, e.g. function call, variable access, macro usage, et cetera. The references are used by the Cross Referencer tool. The flags PI_READACCESS and PI_WRITEACCESS must be set if the referred symbol is a variable (PI_VARIABLE). The function pi_reference() must be called immediately after the function definition, which consists of a call to pi_function() where the PI_DEFINITION flag is set, optionally followed by pi_parameter() calls. In case of a function reference (PI_FUNCTION is set), the actual parameter list can be specified. This can be done by calling pi_parameter() immediately after calling pi_reference().
C/C++ example
foo()
{
bar();
}
SNiFF+ Fuzzy Parser action

pi_data.from: | points to start of " bar "
pi_data.name: | " bar "
pi_data.flags | PI_FUNCTION

SNiFF+ usage
shown in Xref tool

| Note
| If the referenced function is a member of a class, it must also be declared in the project (call of pi_function() (PI_DECLARATION)). Otherwise, SNiFF+ cannot show references made to this member function.